#!/bin/bash
num=1
subnet=$1
while [ $num -lt 255 ]; do
	ping -c 1 -w .2 $subnet.$num >> alive.txt &
	let num=num+1
done

rm live.txt
cat alive.txt | grep "64 bytes from" | cut -d " " -f4 | cut -d ":" -f1 >> live.txt
rm alive.txt
